package top.jafar.data.structures.expression;

public class ItemStringBuilder {
    private StringBuffer innerItem = new StringBuffer();

    public void append(Object o) {
        innerItem.append(o);
    }

    public String getString() {
        String trim = innerItem.toString().trim();
        innerItem.setLength(0);
        return trim;
    }

    public char getChar() {
        char ch = innerItem.charAt(0);
        innerItem.setLength(0);
        return ch;
    }

    public boolean isEmpty() {
        return innerItem.length() == 0;
    }
}
